package com.canyou.activiti.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.canyou.activiti.entity.ProcessInstanceAddDTO;
import com.canyou.activiti.entity.ProcessInstanceVO;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author canyou
 * @since 2021-03-02
 */
public interface ProcessInstanceService {

    /**
     * 分页获取流程实例列表
     *
     * @param page
     * @param processName 流程部署名称
     * @param processKey  流程部署key
     * @return
     */
    IPage<ProcessInstanceVO> getPageList(IPage<ProcessInstanceVO> page, String processName, String processKey);

    /**
     * 删除流程实例
     *
     * @param processInstanceId
     * @param deleteReason
     */
    void deleteProcessInstance(String processInstanceId, String deleteReason);

    /**
     * 激活/挂起流程实例
     *
     * @param processInstanceId
     * @param suspensionState
     */
    void activeOrSuspendProcessInstance(String processInstanceId, Integer suspensionState);

    /**
     * 启动流程实例
     *
     * @param processInstanceAddDTO
     * @return
     */
    ProcessInstanceVO startProcessInstance(ProcessInstanceAddDTO processInstanceAddDTO);

}
